#include <iostream>
#include<math.h>
using namespace std;
class Point 
{
    private:
    	double X,Y;
	public:
		Point();
		Point(double a,double b);
		double GetX();
		double GetY();
		friend double GetLength (Point &A,Point &B);	
};
Point::Point(double a,double b)
{
	X=a;
	Y=b;
}
double Point::GetX()
{
	return X;
}
double Point::GetY()
{
	return Y;
}
double GetLength (Point &A,Point &B)
{
	return (sqrt((A.X-B.X)*(A.X-B.X)+(A.Y-B.Y)*(A.Y-B.Y)));
}
int main()
{
	Point po1(0,0),po2(3,4);
	double length,X,Y;
	cout<<"第一个端点坐标为";
	cout<<po1.GetX()<<","<<po1.GetY()<<endl;
	cout<<"第二个端点坐标为";
	cout<<po2.GetX()<<","<<po2.GetY()<<endl;
	cout<<"线段长度为";
	length=GetLength(po1,po2);
	cout<<length<<endl;
	return 0;
}
